from functools import partialmethod
import re
from sys import flags


filename = input("请输入文件名")
flag = 0
with open(filename,'r',encoding='utf8') as f:
    content = f.readlines()
    for i in content:
        i = i.strip()
        if i.startswith(("###","##","#")):
            if flag == 1 and i.count("#") == 1:
                continue
            if i.count("#") == 1 :
                flag = 1
            partname = i.replace('#','').replace('*','').strip().replace("?","")
            if i.count("<") and i.count(">"):  
                partname = re.sub('<[^<]+?>', '', partname).replace('\n', '').strip()
            partid = partname.replace('.','').replace('_','')
            partid = partid.replace('\\','').replace(' ','-').replace('(','').replace(')','')
            partid = partid.lower()
            
            print((i.count("#")-1)*"  "+"* ["+partname+"]" +"("+filename+"#"+ partid +")")
            
x = input()
